package cn.doitedu.hbase.demo;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Table;

import java.io.IOException;

public class FlushTest {
    public static void main(String[] args) throws IOException {
        Configuration conf = HBaseConfiguration.create();
        conf.set("hbase.zookeeper.quorum","doitedu01:2181");
        Connection conn = ConnectionFactory.createConnection(conf);
        Table bw = conn.getTable(TableName.valueOf("bw"));


        Put put = new Put("r1".getBytes(), 444L);
        put.addColumn("f".getBytes(),"a".getBytes(),"2".getBytes());

        bw.put(put);

        bw.close();
        conn.close();


    }
}
